package net.xgs.rbac;

import net.xgs.rbac.config.RouteVo;
import net.xgs.rbac.endpoint.RbacEndPoint;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.web.mappings.MappingDescriptionProvider;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

import java.util.Collection;

/**
 * @author Administrator
 */
@SpringBootApplication
public class RbacApplication {

    public RbacApplication(Collection<MappingDescriptionProvider> descriptionProviders, ApplicationContext context) {
        this.descriptionProviders = descriptionProviders;
        this.context = context;
    }

    public static void main(String[] args) {
        SpringApplication.run(RbacApplication.class, args);
    }

    private final Collection<MappingDescriptionProvider> descriptionProviders;
    private final ApplicationContext context;

    @Bean
    public RbacEndPoint loginEndPoint() {

        return new RbacEndPoint(this.descriptionProviders,this.context);

    }
}
